<?php defined('InShopNC') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3><?php echo $lang['member_index_manage']?></h3>
      <ul class="tab-base">
        <li><a href="index.php?act=member&op=member"><span><?php echo $lang['nc_manage']?></span></a></li>
        <li><a href="index.php?act=member&op=member_add" ><span><?php echo $lang['nc_new']?></span></a></li>
        <li><a href="index.php?act=member&op=member_export" ><span>导出</span></a></li>
        <li><a href="JavaScript:void(0);" class="current" ><span>用户分析</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>

  <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th colspan="12"><div class="title">
            <h5><?php echo $lang['nc_prompts'];?></h5>
            <span class="arrow"></span></div></th>
      </tr>
      <tr>
        <td><ul>
            <li>各省份用户统计表</li>
           
          </ul></td>
      </tr>
    </tbody>  
  </table>
</div>
 
 <div>

    	<?php if(!empty($output['provice_list']) && is_array($output['provice_list'])){ ?>
        <?php foreach($output['provice_list'] as $k => $v){ ?>
        <b style="width:100px;margin-left: 20px; ">
        	<?php if(empty($v['mobile_province'])){
        	    echo '未知地址：'.$v['count'];
        	}else {
        	    echo $v['mobile_province'].'：'.$v['count'];
        	}?>
        </b>
        <?php }}?>
</div>
 <div id="main" style="height:400px"></div>
 
<script src="<?php echo RESOURCE_SITE_URL.'/lib/echarts-2.2.7/build/dist/echarts.js';?>"></script>
<script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: "<?php echo  RESOURCE_SITE_URL.'/lib/echarts-2.2.7/build/dist';?>"
            }
        });

        // 使用
        require(
            [
                'echarts',
                'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main')); 
                var option = {
                    tooltip: {
                        show: true
                    },
                    legend: {
                        data:['用户人数']
                    },
                    xAxis : [
                        {
                            type : 'category',
                            //data : ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
                            data : [
                                <?php if(!empty($output['provice_list']) && is_array($output['provice_list'])){ ?>
                                <?php foreach($output['provice_list'] as $k => $v){ 
                                   if (empty($v['mobile_province'])){
                                       echo '\'未知地址\',';
                                   }else echo '\''.$v['mobile_province'].'\',';
                                    
                                ?>
                                        
                                <?php }}?>]
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value'
                        }
                    ],
                    series : [
                        {
                            "name":"用户人数",
                            "type":"bar",
                            //"data":[5, 20, 40, 10, 10, 20]
                            "data":[
                                <?php if(!empty($output['provice_list']) && is_array($output['provice_list'])){ ?>
                                <?php foreach($output['provice_list'] as $k => $v){ 
                                    if (empty($v['mobile_province'])){
                                        echo "1,";
                                    }else echo $v['count'].',';
                                    
                                    
                                ?>
                                        
                                <?php }}?>
							]
                        }
                    ]
                };
        
                // 为echarts对象加载数据 
                myChart.setOption(option); 
            }
        );
    </script>

